package com.roger.query.service.impl;

import org.apache.lucene.index.Term;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.WildcardQuery;

import com.roger.query.service.QueryService;
import com.roger.vo.QueryParams;

/**
 * 通配符查询（含有通配符的字符串(?匹配一个字符，*匹配0或者多个字符)）
 * @author luoweiyi
 *
 */
public class WildcardQueryServiceImpl implements QueryService<QueryParams>{

	@Override
	public Query getQuery(QueryParams params) {
		WildcardQuery query = new WildcardQuery(new Term(params.getField(),params.getSearch()));
		return query;
	}

}
